using SqlSugar;

namespace HtERP.Data
{
    [SugarTable("BackupHistory")]
    public class BackupHistory
    {
        [SugarColumn(IsPrimaryKey = true, IsIdentity = false)]
        public Guid Id { get; set; } = Guid.NewGuid();
        
        [SugarColumn(IsNullable = false)]
        public Guid ScheduleId { get; set; }
        
        [SugarColumn(IsNullable = false)]
        public string ScheduleName { get; set; } = string.Empty;
        
        [SugarColumn(IsNullable = false)]
        public DateTime BackupTime { get; set; } = DateTime.Now;
        
        [SugarColumn(IsNullable = false)]
        public bool IsSuccess { get; set; }
        
        [SugarColumn(IsNullable = true, ColumnDataType = "NVARCHAR(255)")]
        public string BackupFileName { get; set; } = string.Empty;
        
        [SugarColumn(IsNullable = true, ColumnDataType = "NVARCHAR(255)")]
        public string? BackupFilePath { get; set; } = string.Empty;
        
        [SugarColumn(IsNullable = true)]
        public long FileSize { get; set; }
        
        [SugarColumn(IsNullable = true)]
        public double DurationSeconds { get; set; }
        
        [SugarColumn(IsNullable = true, ColumnDataType = "NVARCHAR(50)")]
        public string DatabaseType { get; set; } = string.Empty;
        
        [SugarColumn(IsNullable = true, ColumnDataType = "NVARCHAR(100)")]
        public string DatabaseName { get; set; } = string.Empty;
        
        [SugarColumn(IsNullable = true, ColumnDataType = "TEXT")]
        public string Message { get; set; } = string.Empty;
    }
}